#ifndef XDIVA_EXCEPTION_H
#define XDIVA_EXCEPTION_H

#include <exception>
#include <memory>
#include <string>

/**
 * @brief Basic exception class
 * @note This class is immutable, so it uses shallow copy
 */
class Exception: public std::exception {
public:
	Exception( int code, const char * file, unsigned long line );
	Exception( const char * message, const char * file, unsigned long line );
	Exception( const char * message, int n, const char * file, unsigned long line );
	Exception( const std::string & message, const char * file, unsigned long line );
	Exception( const wchar_t * message, const char * file, unsigned long line );
	Exception( const wchar_t * message, int n, const char * file, unsigned long line );
	Exception( const std::wstring & message, const char * file, unsigned long line );
	virtual ~Exception();

	virtual const char * what() const;
	const std::wstring & getMessage() const;
	const char * getFile() const;
	unsigned long getLine() const;

private:
	class Private;
	std::shared_ptr< Private > p_;
};

#endif
